Package-level declarations

Inherited functions

Link copied to clipboard
inline fun <T> T.applyIf(check: Boolean, action: T.() -> Unit): T
inline fun <T> T.applyIf(check: (T) -> Boolean, action: T.() -> Unit): T

Applies the action to the receiver if the check succeeds. In either case returns the receiver itself.

Link copied to clipboard
inline fun <T, A> T.applyIfNotNull(value: A?, action: T.(A) -> Unit): T

Applies the action to the receiver if the value is not null. In either case returns the receiver itself.

Link copied to clipboard
inline fun <T> T.runIf(check: Boolean, action: T.() -> T): T
inline fun <T> T.runIf(check: (T) -> Boolean, action: T.() -> T): T

Transforms the receiver with the provided action if the check succeeds. Otherwise, returns the unmodified receiver.

Link copied to clipboard
inline fun <T, A> T.runIfNotNull(value: A?, action: T.(A) -> T): T

Transforms the receiver with the provided action if the value is not null. Otherwise, returns the unmodified receiver.

Link copied to clipboard
inline fun <T> Any.takeAs(): T
Link copied to clipboard
inline fun <T> Any.takeAsOrNull(): T?
Link copied to clipboard
infix inline fun <T> Any?.then(next: T): T

Purely cosmetic function for creating cursed one-liners. Disregards the receiver and returns the next value.